package com.nadeem.app.ocr;

import java.io.File;

import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;

public class TesseractExample
{
    public static void main(String[] args) {
    	
        File imageFile = new File("samples/eurotext.png");
        Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping
        instance.setDatapath("/home/jambus/git/tess4j/Tess4J");
        
        /*Tesseract1 instance = new Tesseract1(); // JNA Direct Mapping
        
        System.setProperty("jna.library.path", "tesseractlib");*/
        try {
            String result = instance.doOCR(imageFile);
            System.out.println(result);
        } catch (TesseractException e) {
            e.printStackTrace();
        }
    }
}
